﻿<%@ Import namespace="SOLInfo.HTMLHelpers" %>
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SOLInfo.GEN.Domain.Entities.Noticia>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Listagem
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Listagem</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Titulo
            </th>
            <th>
                DataInicio
            </th>
            <th>
                DataFim
            </th>
            <th>
                PublicadoEm
            </th>
            <th>
                SubTitulo
            </th>
            <th>
                TextoNoticia
            </th>
            <th>
                Imagem
            </th>
            <th>
                URLVideo
            </th>
            <th>
                Fonte
            </th>
            <th>
                Codigo
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Editar", "Edit", new { item.Codigo }) %> |
                <%= Html.ActionLink("Detalhes", "Details", new { item.Codigo })%> |
				<%= Html.LinkExclusao("Tem certeza que deseja excluir?", "Excluir", "SOLInfo.GEN.Domain.Entities.Noticia", item.Codigo.ToString()) %>
            </td>
            <td>
                <%= Html.Encode(item.Titulo) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.DataInicio)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.DataFim)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.PublicadoEm)) %>
            </td>
            <td>
                <%= Html.Encode(item.SubTitulo) %>
            </td>
            <td>
                <%= Html.Encode(item.TextoNoticia) %>
            </td>
            <td>
                <%= Html.Encode(item.Imagem) %>
            </td>
            <td>
                <%= Html.Encode(item.URLVideo) %>
            </td>
            <td>
                <%= Html.Encode(item.Fonte) %>
            </td>
            <td>
                <%= Html.Encode(item.Codigo) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Novo", "Create") %>
    </p>

</asp:Content>

